package com.config.dao;

import com.config.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by chenjie on 2017/5/10.
 */
@Mapper
public interface UserMapper {

    @Select("SELECT * FROM cjweb.`user` a WHERE a.username = #{name}")
     List<User> findByName(@Param("name") String name);

    @Insert("INSERT INTO cjweb.`user`(USERNAME) VALUES(#{name})")
     int insert(@Param("name") String name);
}
